var express = require('express');
var router = express.Router();
var shopCar=require('../controler/shopCar');
var userLogin=require('../middle/userLogin');
/* GET home page. */
router.get('/', userLogin, shopCar.shopCar);

router.post('/login', shopCar.login);
//加入购物车
router.post('/join/:id', userLogin, shopCar.join);

//收藏
router.post('/shoucang/:id', userLogin, shopCar.shoucang);

//取消收藏
router.post('/cancelCollect/:id', userLogin, shopCar.cancelCollect);

//购物车书籍数量加减
router.post('/bookNum', userLogin, shopCar.bookNum);

//生成订单
router.post('/order', userLogin, shopCar.order);

//改变购物车选中商品订单状态
router.post('/checkBox',userLogin, shopCar.checkBox);

//移除商品
router.post('/moveBook',userLogin, shopCar.moveBook);

module.exports = router;